<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="systemuserDetail.title"/></title>
    <meta name="heading" content="<fmt:message key='systemuserDetail.heading'/>"/>
</head>

<c:set var="delObject" scope="request"><fmt:message key="systemuserList.systemuser"/></c:set>
<script type="text/javascript">var msgDelConfirm =
   "<fmt:message key="delete.confirm"><fmt:param value="${delObject}"/></fmt:message>";
</script>

<div class="span2">
    <h2><fmt:message key="systemuserDetail.heading"/></h2>
    <fmt:message key="systemuserDetail.message"/>
</div>

<div class="span7">
    <s:form id="systemuserForm" action="saveSystemuser" method="post" validate="true" cssClass="well form-horizontal">
            <s:hidden key="systemuser.id"/>
        <s:textfield key="systemuser.name" required="false" maxlength="50" />
        <s:textfield key="systemuser.password" required="true" maxlength="50" />
        <s:select name="systemuser.type" list="userTypeList" label="Type"/>
        <s:textfield key="systemuser.username" required="true" maxlength="50" />

        <div id="actions" class="form-actions">
            <s:submit type="button" cssClass="btn btn-primary" method="save" key="button.save" theme="simple">
                <i class="icon-ok icon-white"></i> <fmt:message key="button.save"/>
            </s:submit>
            <c:if test="${not empty systemuser.id}">
                <s:submit type="button" cssClass="btn btn-warning" method="delete" key="button.delete"
                    onclick="return confirmMessage(msgDelConfirm)" theme="simple">
                    <i class="icon-trash icon-white"></i> <fmt:message key="button.delete"/>
                </s:submit>
            </c:if>
            <s:submit type="button" cssClass="btn" method="cancel" key="button.cancel" theme="simple">
                <i class="icon-remove"></i> <fmt:message key="button.cancel"/>
            </s:submit>
        </div>
    </s:form>
    <c:if test="${not empty systemuser.id}">
	    <h2>Authorities</h2>
	    <s:form id="systemuseAuthoritiesForm" action="addSystemUserAuthority" method="post" validate="true" cssClass="well form-horizontal">
	        <s:hidden key="systemuser.id"/>
	     	<s:select name="authority.id" list="authorityList" listKey="id" listValue="name"></s:select>
	     	 <div id="actions" class="form-actions">
	        <s:submit type="button" cssClass="btn btn-primary" method="addSystemUserAuthority" key="button.save" theme="simple">
	            <i class="icon-ok icon-white"></i> add
	        </s:submit>
	        </div>
		</s:form>
		 <display:table name="systemuser.authorities" class="table table-condensed table-striped table-hover" requestURI="" id="authorityList" export="true" pagesize="25">
		        <display:column property="id" sortable="true" href="editAuthority" media="html"
		            paramId="id" paramProperty="id" titleKey="authority.id"/>
		        <display:column property="id" media="csv excel xml pdf" titleKey="authority.id"/>
		        <display:column property="name" sortable="true" titleKey="authority.name"/>
		          <display:column>
		           <s:form id="systemuseAuthoritiesForm" action="deleteSystemUserAuthority" method="post" validate="true">
					    <s:hidden key="systemuser.id"/>
					    <s:hidden value="%{#attr.authorityList.id}" name="authority.id"/>
					    <s:submit type="button" cssClass="btn btn-primary" method="deleteSystemUserAuthority" key="button.delete" theme="simple">
					        <i class="icon-ok icon-white"></i> delete
					    </s:submit>
					</s:form>
		          </display:column>
		        <display:setProperty name="paging.banner.item_name"><fmt:message key="authorityList.authority"/></display:setProperty>
		        <display:setProperty name="paging.banner.items_name"><fmt:message key="authorityList.authorities"/></display:setProperty>
		
		        <display:setProperty name="export.excel.filename"><fmt:message key="authorityList.title"/>.xls</display:setProperty>
		        <display:setProperty name="export.csv.filename"><fmt:message key="authorityList.title"/>.csv</display:setProperty>
		        <display:setProperty name="export.pdf.filename"><fmt:message key="authorityList.title"/>.pdf</display:setProperty>
		</display:table>
		

		<h2>News List</h2>
		<display:table name="systemuser.newses" class="table table-condensed table-striped table-hover" requestURI="" id="newsList" export="true" pagesize="25">
	        <display:column property="id" sortable="true" href="editNews" media="html"
	            paramId="id" paramProperty="id" titleKey="news.id"/>
	        <display:column property="id" media="csv excel xml pdf" titleKey="news.id"/>
	        <display:column property="postDate" sortable="true" titleKey="news.postDate"/>
	        <display:column property="title" sortable="true" titleKey="news.title"/>
	        <display:column property="viewTimes" sortable="true" titleKey="news.viewTimes"/>
	        <display:column property="systemuser.name" href="editSystemuser" media="html"
	            paramId="id" paramProperty="systemuser.id" title="Poster" sortable="true"/>
	        <display:column property="picturenews.pictureName" href="editPictureNews" media="html"
	            paramId="id" paramProperty="picturenews.id" titleKey="news.picturenews" sortable="true"/>
	
	        <display:setProperty name="paging.banner.item_name"><fmt:message key="newsList.news"/></display:setProperty>
	        <display:setProperty name="paging.banner.items_name"><fmt:message key="newsList.newss"/></display:setProperty>
	
	        <display:setProperty name="export.excel.filename"><fmt:message key="newsList.title"/>.xls</display:setProperty>
	        <display:setProperty name="export.csv.filename"><fmt:message key="newsList.title"/>.csv</display:setProperty>
	        <display:setProperty name="export.pdf.filename"><fmt:message key="newsList.title"/>.pdf</display:setProperty>
	    </display:table>
	    
	    <h2>Notice List</h2>
	     <display:table name="systemuser.notices" class="table table-condensed table-striped table-hover" requestURI="" id="noticeList" export="true" pagesize="25">
	        <display:column property="id" sortable="true" href="editNotice" media="html"
	            paramId="id" paramProperty="id" titleKey="notice.id"/>
	        <display:column property="id" media="csv excel xml pdf" titleKey="notice.id"/>
	        <display:column property="postDate" sortable="true" titleKey="notice.postDate"/>
	        <display:column property="title" sortable="true" titleKey="notice.title"/>
	        <display:column property="viewTimes" sortable="true" titleKey="notice.viewTimes"/>
	 		<display:column property="systemuser.name" href="editSystemuser" media="html"
	            paramId="id" paramProperty="systemuser.id" title="Poster" sortable="true"/>
	        <display:column property="department.name" href="editDepartment" media="html"
	            paramId="id" paramProperty="department.id" title="Department" sortable="true"/>
	
	        <display:setProperty name="paging.banner.item_name"><fmt:message key="noticeList.notice"/></display:setProperty>
	        <display:setProperty name="paging.banner.items_name"><fmt:message key="noticeList.notices"/></display:setProperty>
	
	        <display:setProperty name="export.excel.filename"><fmt:message key="noticeList.title"/>.xls</display:setProperty>
	        <display:setProperty name="export.csv.filename"><fmt:message key="noticeList.title"/>.csv</display:setProperty>
	        <display:setProperty name="export.pdf.filename"><fmt:message key="noticeList.title"/>.pdf</display:setProperty>
	    </display:table>
	    
	    <h2>Event List</h2>
	      <display:table name="systemuser.event" class="table table-condensed table-striped table-hover" requestURI="" id="eventList" export="true" pagesize="25">
	        <display:column property="id" sortable="true" href="editEvent" media="html"
	            paramId="id" paramProperty="id" titleKey="event.id"/>
	        <display:column property="id" media="csv excel xml pdf" titleKey="event.id"/>
	        <display:column property="postDate" sortable="true" titleKey="event.postDate"/>
	        <display:column property="title" sortable="true" titleKey="event.title"/>
	        <display:column property="viewTimes" sortable="true" titleKey="event.viewTimes"/>
	        <display:column sortProperty="endDate" sortable="true" titleKey="event.endDate">
	             <fmt:formatDate value="${eventList.endDate}" pattern="${datePattern}"/>
	        </display:column>
	        <display:column property="location" sortable="true" titleKey="event.location"/>
	        <display:column sortProperty="startDate" sortable="true" titleKey="event.startDate">
	             <fmt:formatDate value="${eventList.startDate}" pattern="${datePattern}"/>
	        </display:column>
	        <display:column property="type" sortable="true" titleKey="event.type"/>
	       <display:column property="systemuser.name" href="editSystemuser" media="html"
	            paramId="id" paramProperty="systemuser.id" title="Poster" sortable="true"/>
	            
	        <display:setProperty name="paging.banner.item_name"><fmt:message key="eventList.event"/></display:setProperty>
	        <display:setProperty name="paging.banner.items_name"><fmt:message key="eventList.events"/></display:setProperty>
	
	        <display:setProperty name="export.excel.filename"><fmt:message key="eventList.title"/>.xls</display:setProperty>
	        <display:setProperty name="export.csv.filename"><fmt:message key="eventList.title"/>.csv</display:setProperty>
	        <display:setProperty name="export.pdf.filename"><fmt:message key="eventList.title"/>.pdf</display:setProperty>
	    </display:table>
	    
	     <h2>Downloads List</h2>
	     <display:table name="systemuser.downloads" class="table table-condensed table-striped table-hover" requestURI="" id="downloadsList" export="true" pagesize="25">
	        <display:column property="id" sortable="true" href="editDownloads" media="html"
	            paramId="id" paramProperty="id" titleKey="downloads.id"/>
	        <display:column property="id" media="csv excel xml pdf" titleKey="downloads.id"/>
	        <display:column property="postDate" sortable="true" titleKey="downloads.postDate"/>
	        <display:column property="title" sortable="true" titleKey="downloads.title"/>
	        <display:column property="viewTimes" sortable="true" titleKey="downloads.viewTimes"/>
	        <display:column property="filename" sortable="true" titleKey="downloads.filename" href="downloadsfile"
	      	  paramId="downloadsid" paramProperty="id"/>
			 <display:column property="systemuser.name" href="editSystemuser" media="html"
			            paramId="id" paramProperty="systemuser.id" title="Poster" sortable="true"/>
	            
	        <display:setProperty name="paging.banner.item_name"><fmt:message key="downloadsList.downloads"/></display:setProperty>
	        <display:setProperty name="paging.banner.items_name"><fmt:message key="downloadsList.downloadss"/></display:setProperty>
	
	        <display:setProperty name="export.excel.filename"><fmt:message key="downloadsList.title"/>.xls</display:setProperty>
	        <display:setProperty name="export.csv.filename"><fmt:message key="downloadsList.title"/>.csv</display:setProperty>
	        <display:setProperty name="export.pdf.filename"><fmt:message key="downloadsList.title"/>.pdf</display:setProperty>
	    </display:table>
	    
	    <h2>Video List</h2>
	    <display:table name="systemuser.videos" class="table table-condensed table-striped table-hover" requestURI="" id="videoList" export="true" pagesize="25">
	        <display:column property="id" sortable="true" href="editVideo" media="html"
	            paramId="id" paramProperty="id" titleKey="video.id"/>
	        <display:column property="id" media="csv excel xml pdf" titleKey="video.id"/>
	        <display:column property="postDate" sortable="true" titleKey="video.postDate"/>
	        <display:column property="title" sortable="true" titleKey="video.title"/>
	        <display:column property="viewTimes" sortable="true" titleKey="video.viewTimes"/>
	        <display:column property="youtubeUrl" sortable="true" titleKey="video.youtubeUrl"/>
	 		<display:column property="systemuser.name" href="editSystemuser" media="html"
	            paramId="id" paramProperty="systemuser.id" title="Poster" sortable="true"/>
	            
	        <display:setProperty name="paging.banner.item_name"><fmt:message key="videoList.video"/></display:setProperty>
	        <display:setProperty name="paging.banner.items_name"><fmt:message key="videoList.videoes"/></display:setProperty>
	
	        <display:setProperty name="export.excel.filename"><fmt:message key="videoList.title"/>.xls</display:setProperty>
	        <display:setProperty name="export.csv.filename"><fmt:message key="videoList.title"/>.csv</display:setProperty>
	        <display:setProperty name="export.pdf.filename"><fmt:message key="videoList.title"/>.pdf</display:setProperty>
	    </display:table>
	    
	     <h2>Log List</h2>
	     <display:table name="systemuser.logs" class="table table-condensed table-striped table-hover" requestURI="" id="logList" export="true" pagesize="25">
	        <display:column property="id" sortable="true" href="editLog" media="html"
	            paramId="id" paramProperty="id" titleKey="log.id"/>
	        <display:column property="id" media="csv excel xml pdf" titleKey="log.id"/>
	        <display:column property="actionDetails" sortable="true" titleKey="log.actionDetails"/>
	        <display:column sortProperty="logDate" sortable="true" titleKey="log.logDate">
	             <fmt:formatDate value="${logList.logDate}" pattern="${datePattern}"/>
	        </display:column>
	        <display:column property="systemuser.name" href="editSystemuser" media="html"
	            paramId="id" paramProperty="systemuser.id" title="Poster" sortable="true"/>
	
	        <display:setProperty name="paging.banner.item_name"><fmt:message key="logList.log"/></display:setProperty>
	        <display:setProperty name="paging.banner.items_name"><fmt:message key="logList.logs"/></display:setProperty>
	
	        <display:setProperty name="export.excel.filename"><fmt:message key="logList.title"/>.xls</display:setProperty>
	        <display:setProperty name="export.csv.filename"><fmt:message key="logList.title"/>.csv</display:setProperty>
	        <display:setProperty name="export.pdf.filename"><fmt:message key="logList.title"/>.pdf</display:setProperty>
	    </display:table>
	</c:if>
</div>

<script type="text/javascript">
    $(document).ready(function() {
        $("input[type='text']:visible:enabled:first", document.forms['systemuserForm']).focus();
    });
</script>
